﻿
namespace EasyStep.TestActions.WebDriverFactories
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using OpenQA.Selenium;
    using EasyStep.TestExecution.Browsers;
    using EasyStep.TestExecution.Interfaces;
    using System.Drawing;
    using EasyStep.TestExecution.Data;
    using EasyStep.TestActions.Utils;
    using OpenQA.Selenium.Remote;


    public class FireFox : BaseWebBrowserProxy<IWebDriver>
    {
        public FireFox() : base("FireFox", "FireFox.png", "") { }

        public override object GetNewInstance(IExecuteDataContext context)
        {
            var driver = new OpenQA.Selenium.Firefox.FirefoxDriver();
            driver.Manage().Window.Maximize();
            return driver;
        }
        public override Image MakeScreenshot(IExecuteDataContext DataContext, TestStepResult data)
        {
            return BrowserHelper.MakeScreenshot(DataContext, data);
        }
        public override void FinalizeInstance(object dataInstance)
        {
            var data = dataInstance as IWebDriver;
            if (data == null) return;
            data.Quit();
        }
    }
}
